package org.microservice.service.feign;

import feign.Param;
import feign.RequestLine;
import org.microservice.config.FeignConfiguration;
import org.microservice.entity.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

//@FeignClient(name = "microservice-provider-user", configuration = FeignConfiguration.class, fallback = UserFeignClientFallback.class)
@FeignClient(name = "microservice-provider-user", configuration = FeignConfiguration.class, fallbackFactory = UserFeignClientFallbackFactory.class)
public interface UserFeignClient {

//    @RequestLine(value = "GET /{id}")
//    User findById(@Param("id") Long id);
    
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    User findById(@PathVariable("id") Long id);
    
//    @RequestMapping(value = "/get", method = RequestMethod.GET)
//    User getMethod(@RequestParam("id") Long id, @RequestParam("name") String name);
//
//    @RequestMapping(value = "/get", method = RequestMethod.GET)
//    User getMethodMap(@RequestParam Map<String, Object> map);
//
//    @RequestMapping(value = "/post", method = RequestMethod.POST)
//    User postMethod(@RequestBody User user);
}
